<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/newtag',
    'namespace' => 'Frieza\\Modules\\Newtag\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {

    // 标签列表
    $router->get('/list', 'TagController@list');
    //获取父标签
    $router->get('/list/edit/tagtype/{q?}', 'TagController@getTagType');
    // 编辑
    $router->get('/list/{id}/edit', 'TagController@edit');
    // 创建
    $router->get('/list/create', 'TagController@edit')->name('list.create');

    // 保存
    $router->post('/list/save', 'TagController@saveSubmit');
    // 删除
    $router->delete('/list/{id}', 'TagController@del');
    //获取子标签
    $router->get('/list/tagchildren/{q?}', 'TagController@getTagChildren');


    // 标签树
    $router->get('/treelist', 'TagPackageController@treeList');

    //标签打包相关
    $router->get('/packagelist', 'TagPackageController@list');
    $router->put('/packagelist/{id}', 'TagPackageController@editDescription');
    // 创建
    $router->get('/packagelist/create', 'TagPackageController@create');
    // 编辑
    $router->get('/packagelist/{id}/edit', 'TagPackageController@create');
    // 保存
    $router->post('/packagelist/save', 'TagPackageController@saveSubmit');
    // 删除
    $router->delete('/packagelist/{id}', 'TagPackageController@del');
    // 编辑包中标签
    $router->get('/packagelist/edittags/{id}', 'TagPackageController@editTags');
    // 编辑包中标签提交
    $router->post('/packagelist/edittags/{id}/submit', 'TagPackageController@editTagsSubmit');



    //分包用途列表
    $router->get('/application', 'TagPackageController@applicationList');
    //保存
    $router->post('/application', 'TagPackageController@applicationSaveSubmit');
    $router->put('/application/{id}', 'TagPackageController@applicationSaveSubmit');
    //删除
    $router->delete('/application/{id}', 'TagPackageController@delApplication');



});
